<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./vue.js"></script>
  <style>
    .c {
      width: 300px;
      height: 300px;
      background-color: aquamarine;
    }

    .b {
      width: 200px;
      height: 200px;
      background-color: rgb(37, 156, 13);
    }

    .a {
      width: 100px;
      height: 100px;
      background-color: rgb(207, 127, 190);
    }
  </style>
</head>

<body>
  <div id="app">
    <h1>{{count}}</h1>
    <!-- 
    <button @click="count+=1">increment1</button>
    <button @click="handleClick1(5,$event)">increment2</button>

    <div class="c" @click="clickc">
      c
      <div class="b" @click.self.stop="clickb">
        b
        <div class="a" @click.capture="clicka">
          a
        </div>

      </div>

    </div> -->
    <hr>

    <a @click.prevent href="https://www.baidu.com">百度</a>
    <button @click.once="handleClick">我是一个按钮</button>

    <input v-model="count" type="text" @keyup.enter="handleInput">

  </div>

  <script>

    var vm = new Vue({
      el: "#app",
      data: {
        count: 1
      },
      methods: {
        handleInput() {
          alert(this.count)
        },
        handleClick(event) {
          this.count += 1;
          console.log(event.target)
        },
        handleClick1(num, event) {
          this.count += num;
          console.log(event)
        },
        clicka() {
          console.log('a')
        },
        clickb() {
          console.log('b')
        }
        , clickc() {
          console.log('c')
        }
      }
    })
  </script>

</body>

</html>